<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>12-作用域</title>
  </head>

  <body>
    <script>
      //1. 全局变量
      let num = 10
      console.log(num)
      function fn() {
        console.log(num)
      }
      fn()

      //2. 局部变量
      function fun() {
        let str = 'pink'
      }
      console.log(str)
    </script>
  </body>
</html>
